<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
		<script src="./lib/echarts.min.js"></script>
	</head>
	<body>
		<div style="width: 600px; height: 400px"></div>

		<script type="text/javascript">
			//初始化Echarts实例对象
			let mCharts = echarts.init(document.querySelector('div'));
			//准备配置项
			let xData = ['张三', '李四', '王五', '闰土', '小明', '三看', '大强'];
			let yData = [84, 43, 68, 79, 90, 98, 57];
			let option = {
				grid: {
					show: true,
					borderWidth: 10,
					borderColor: 'red',
					left: 120,
					top: 120,
					width: 300,
					height: 150,
				},
				//图标的 x 轴
				xAxis: {
					type: 'category',
					data: xData,
				},
				yAxis: {
					type: 'value',
				},
				//系列列表
				series: [
					{
						name: '语文',
						type: 'bar',
						markPoint: {
							data: [
								{
									type: 'max',
									name: '最大值',
								},
								{
									type: 'min',
									name: '最小值',
								},
							],
						},
						markLine: {
							data: [
								{
									type: 'average',
									name: '平均值',
								},
							],
						},
						label: {
							show: true,
							rotate: 15,
						},
						barWidth: '50%',
						data: yData,
					},
				],
			};
			//将配置项给echarts实例对象
			mCharts.setOption(option);
		</script>
	</body>
</html>
